
Last chance! 50% off unlimited learning
Sale ends in
Projection pursuit regression for compositional data.
comp.ppr(y, x, nterms = 3, type = "alr", xnew = NULL, yb = NULL )
A matrix with the compositional data.
A matrix with the continuous predictor variables or a data frame including categorical predictor variables.
The number of terms to include in the final model.
Either "alr" or "ilr" corresponding to the additive or the isometric log-ratio transformation respectively.
If you have new data use it, otherwise leave it NULL.
If you have already transformed the data using a log-ratio transformation put it here. Othewrise leave it NULL.
A list includign:
The runtime of the regression.
The produced model as returned by the function "ppr".
The fitted values of xnew if xnew is not NULL.
This is the standard projection pursuit. See the built-in funciton "ppr" for more details.
Friedman, J. H. and Stuetzle, W. (1981). Projection pursuit regression. Journal of the American Statistical Association, 76, 817-823. doi: 10.2307/2287576.
# NOT RUN {
x <- as.matrix( iris[, 1:4] )
x <- x/ rowSums(x)
ina <- iris[, 5]
mod <- comp.knn(x, x, ina, a = 1, k = 5)
table(ina, mod)
mod2 <- alfa.knn(x, x, ina, a = 1, k = 5)
table(ina, mod2)
# }
Run the code above in your browser using DataLab